package com.yunatt.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunatt.model.EnrollInfoEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EnrollInfoMapper extends BaseMapper<EnrollInfoEntity> {



    @Delete("delete from enrollinfo where enroll_id=#{enrollId,jdbcType=BIGINT}")
    int deleteByEnrollId(@Param("enrollId") Long id);

    @Select(" select id,enroll_id,backupnum,imagepath,signatures from enrollinfo where enroll_id=#{enrollId,jdbcType=BIGINT} and backupnum=#{backupnum,jdbcType=INTEGER} limit 1")
    EnrollInfoEntity selectByBackupnum(@Param("enrollId")Long enrollId,@Param("backupnum")int backupnum);



    @Select("select * from enrollinfo")
    List<EnrollInfoEntity> selectAll();


    @Select(" select id,enroll_id,backupnum,imagepath,signatures from enrollinfo where enroll_id=#{enrollId,jdbcType=BIGINT}")
    List<EnrollInfoEntity> selectByEnrollId(@Param("enrollId") Long enrollId);
}